<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="vue">
    <div>{{info.name}}</div>
</div>

<!--导入vue.js编写js代码-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript">
    let vm = new Vue({
        el:"#vue",
        data(){
            return{
                //请求的返回参数合适，必须和json字符串一样
                info:{
                    name: null,
                    address: {
                        street:null,
                        city: null,
                        country: null
                    }
                }
            }
        },
        mounted(){//钩子函数 链式编程 ES6特性
            axios.get("../data.json").then(response=>(this.info=response.data));
        }
    });
</script>

</body>
</html>